package com.xuchaotong.entity;

/**
 * @author 311633
 * @version 1.0
 * @ClassName:
 * @Description:
 * @date 2018/1/26 14:49
 */
public class User {
    private String name;

    public User() {
    }

    public User(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }


    @Override
    public String toString() {
        return name == null ? "" : "["+ name +"]";
    }

    @Override
    public boolean equals(Object obj) {
        if(obj == null) return false;
        if(obj instanceof User){
            User u = (User)obj;
            if(name.equals(u.getName())) return true;
        }

        return false;
    }

    @Override
    public int hashCode() {
        return name == null ? 0 : name.hashCode() ^ (name.hashCode() >>> 16);
    }
}
